package com.fs.chatx.module.chat.enums;

public enum MessageType
{
    TEXT(0),       // 纯文本
    ATTACH(1) // 图片卡片
 ;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    private MessageType(Integer index) {
        this.code = index;
    }


    public  MessageType getMessageType(Integer index) {
       for (MessageType messageType : MessageType.values()) {
           if (messageType.getCode().equals(index)) {
               return messageType;
           }
       }
       return null;
    }

}
